﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Automobile.service.Model;
using Automobile.service.BLL;
using System.Data;
namespace Automobile.service.UI.Handler
{
    /// <summary>
    /// HandlerDocument 的摘要说明
    /// </summary>
    public class HandlerDocument : IHttpHandler
    {
        DocumentBLL bll = new DocumentBLL();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Document P = new Document();
            P.Document_Date = Convert.ToDateTime(context.Request["Document_Date"]);
            P.Document_Remark = context.Request["Document_Remark"];
            P.Document_Type_Name =context.Request["Document_Type_Name"];
            P.WareHose_Id = Convert.ToInt32(context.Request["WareHose_Id"]);
            P.Employee_Id = Convert.ToInt32(context.Request["Employee_Id"]);
            P.Document_num = context.Request["Document_num"];
            string xml = context.Server.UrlDecode(context.Request.Form["xml"].ToString());
            context.Response.Write(bll.Document_Add(P, xml));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}